<?php
    use Zend\Session\Container;

    $action = $this->isRegistred ? $this->url('authentication', array('action' => 'login')) : $this->url('authentication', array('action' => 'signUp'));
    $value = $this->isRegistred ? "login" : "sign in";
    $errorsContainer = new Container("ERRORS");
?>

<article class="managemant">
    <?php
        if ($errorsContainer->offsetGet('error_authentication') != null) {
            $errorMsg = $errorsContainer->offsetGet("error_authentication");
            echo "<div class='alert alert-error'>$errorMsg</div>";
            $errorsContainer->getManager()->getStorage()->clear("ERRORS");
        }
    ?>
    <form name="authentication" method="post" action="<?php echo $action; ?>">
        <label>Username</label>
        <input type="text" name="username"/>
        <label>Password</label>
        <input type="password" name="password"/></br>
        <input type="submit" name="submit" value="<?php echo $value; ?>" class="btn">
    </form>
</article>
